package com.yuju.controller.hotel;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONObject;
import com.yuju.common.Result;
import com.yuju.controller.base.BaseController;
import com.yuju.enums.ReturnCodeEnum;
import com.yuju.enums.ReturnStatusEnum;
import com.yuju.order.enums.ReserveReturnCodeEnum;
import com.yuju.order.model.ReserveModel;
import com.yuju.order.service.IReserverService;
import com.yuju.util.Utils;
import com.yuju.vo.order.ReserveVO;

/**
 * 
 * 类名：DueToArriveInController  <br />
 *
 * 功能：预抵报表
 *
 * @author : zhousc <br />
 * @Date : 2017年12月20日 上午10:32:59  <br />
 * @version : 1.1 <br />
 */
@Controller
@RequestMapping("dueToArriveIn")
public class DueToArriveInController extends BaseController<ReserveVO, ReserveModel> {

	@Autowired 
	private IReserverService reserverService;
	
	@RequestMapping("selectDueToArriveInByDate")
	@ResponseBody
	public Result name(@RequestBody JSONObject obj) {
		ReserveVO reserveVO = obj.toJavaObject(ReserveVO.class);
		Result result = new Result();
		List<ReserveModel> list = reserverService.dueToArriveIn(convert(reserveVO));
		if (Utils.isNotNull(list) && Utils.isNotNull(list)) {
			result.setRows(list);
			result.setStatus(ReturnStatusEnum.SUCCESS.getCode());
			result.setMsg(ReturnStatusEnum.SUCCESS.getDesc());
			result.setReturnCode(ReserveReturnCodeEnum.RESERVE_QUERY_SUCCESS.getCode());
			result.setReturnMsg(ReserveReturnCodeEnum.RESERVE_QUERY_SUCCESS.getDesc());
		} else {
			result = new Result();
			result.setStatus(ReturnStatusEnum.FAILURE.getCode());
			result.setMsg(ReturnStatusEnum.FAILURE.getDesc());
			result.setReturnCode(ReturnCodeEnum.NO_DATA.getCode());
			result.setReturnMsg(ReturnCodeEnum.NO_DATA.getDesc());
		}
		return result;
	}
	
}
